package com.xiaomazi.order.service;

import com.xiaomazi.common.utils.R;
import com.xiaomazi.order.entity.Order;
import com.baomidou.mybatisplus.extension.service.IService;
public interface OrderService extends IService<Order>{


    /**
     * 根据课程id生成订单号
     * @param courseId 课程id
     * @return 订单号
     */
    R createOrder(String courseId,String userId);

    /**
     * 根据订单号查询订单
     * @param orderId 订单号
     * @return Order
     */
    R getOrderByOrderId(String orderId);

    /**
     * 根据课程id和用户id查询订单表中订单状态
     * @param courseId 课程id
     * @param memberId 用户id
     * @return boolean
     */
    boolean isBuyCourse(String courseId, String memberId);
}
